from django.db import models

# Create your models here.

class User(models.Model):

    gender = (
        ('male', "男"),
        ('female', "女"),
    )

    username = models.CharField('用户名',max_length=128, unique=True)
    password = models.CharField('密码',max_length=128)
    telephone = models.CharField('电话号码',max_length=16)
    sex = models.CharField('性别',max_length=32, choices=gender, default="男")
    c_time = models.DateTimeField('创建时间',auto_now_add=True)
    u_time = models.DateTimeField('修改时间',auto_now=True)
    is_active = models.BooleanField('是否活跃',default=True)

    def __str__(self):
        return self.username

    class Meta:
        ordering = ["-c_time"]
        verbose_name = "用户"
        verbose_name_plural = "用户"